package com.triones.yjj.controller.web;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.triones.yjj.entity.bo.ActivityListParams;
import com.triones.yjj.entity.bo.ComplainListParams;
import com.triones.yjj.entity.vo.ComplainListVO;
import com.triones.yjj.entity.vo.VisitAuthActivityListVO;
import com.triones.yjj.service.ComplainService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 客户管理
 *
 * @Author: triones
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/system/complain")
public class ComplainController extends BaseController {

    private final ComplainService complainService;

    /**
     * 查询投诉列表（分页）
     */
    @GetMapping("/pageList")
    public TableDataInfo<ComplainListVO> pageList(ComplainListParams params, PageQuery pageQuery) {
        return complainService.pageList(params, pageQuery);
    }

    /**
     * 恢复访问权限
     */
    @PostMapping("/restoreVisitAuth/{id}")
    public R<Void> restoreVisitAuth(@PathVariable Long id) {
        return toAjax(complainService.restoreVisitAuth(id));
    }
}
